from sqlalchemy.orm import Session
from . import crud, schemas

class TodoService:
    def get_all_todos_with_filter(self, db: Session, completed: bool, skip: int = 0, limit: int = 100):
        # Example of a service layer method that adds business logic
        # In a real app, this might involve more complex filtering or data transformation
        todos = crud.get_todos(db, skip=skip, limit=limit)
        if completed is not None:
            return [todo for todo in todos if todo.completed == completed]
        return todos

todo_service = TodoService()